package org.smog.core.config.security.model;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * jwt 内容
 * @Description: Created by IntelliJ IDEA.
 * @project_name: smogTemp
 * @time: 2020-05-14 11:22
 * @email: 17685306043@163.com
 * @author: huangZhongYao
 */
public class JwtUser extends User {

    /**
     * 用户ID
     */
    private String id;
    /**
     * 用户名真实姓名
     */
    private String realName;
    /**
     * 用户登录设备Id
     */
    private String deviceId;

    public JwtUser(String id, String realName, String deviceId, String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.setId(id);
        this.setRealName(realName);
        this.setDeviceId(deviceId);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
}
